package com.csii.mobilebanking.funbox;

import com.csii.mobilebanking.R;
import com.csii.mobilebanking.funbox.jar.beans.PluginFeatureMethod;
import com.csii.mobilebanking.funbox.jar.beans.PluginIntent;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.Spannable;
import android.text.style.ImageSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * @author 作者 E-mail:hangxin1940@gmail.com
 * @version 创建时间：2011-12-16 上午11:39:35 插件item视图
 */
public class PluginItemIndexView extends LinearLayout {
	private Context context;

	private TextView icon;
	private TextView des;

	public PluginItemIndexView(Context context) {
		super(context);

		this.context = context;
		LayoutInflater layoutinflater = LayoutInflater.from(context);
		View view = layoutinflater.inflate(R.layout.plugin_item, this, true);
		icon = (TextView) view.findViewById(R.id.funbox_item);
		des = (TextView) view.findViewById(R.id.des);
	}

	public void setLogoImage(Drawable d) {
		icon.setBackgroundDrawable(d);
	}

	public void setDes(String text) {
		des.setText(text);
	}
	
//	public void addPluginMethod(PluginFeatureMethod method,OnClickListener ocl){
//		Button btn=new Button(context);
//		btn.setText(method.getDescription());
//		btn.setOnClickListener(ocl);
//		llFeatures.addView(btn);
//	}
	
	public void addPluginMethod(PluginIntent intent,OnClickListener ocl){
		icon.setOnClickListener(ocl);
	}
}
